﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using TeenyGrab.Outputs;
using System.Windows.Forms;
using System.Drawing.Imaging;
using TeenyGrab.Helpers;
using TeenyGrab.Serialization;

namespace TeenyGrab.Windows
{
    /// <summary>
    /// Interaction logic for ConfigureFileOutputWindow.xaml
    /// </summary>
    public partial class ConfigureImgurOutputWindow : Window
    {
        private ImgurOutput Output { get; set; }
        public ConfigureImgurOutputWindow(ImgurOutput output)
        {
            this.Output = output;

            InitializeComponent();

            comboBoxFiletype.ItemsSource = new List<ImageFormat>()
            {
                ImageFormat.Bmp,
                ImageFormat.Emf,
                ImageFormat.Exif,
                ImageFormat.Gif,
                ImageFormat.Icon,
                ImageFormat.Jpeg,
                ImageFormat.Png,
                ImageFormat.Tiff,
                ImageFormat.Wmf,
            };
            if (output.Format != null)
            {
                comboBoxFiletype.SelectedValue = output.Format.Format;
            }
        }

        private void buttonOK_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            Output.Format = new SerializableImageFormat(comboBoxFiletype.SelectedItem as ImageFormat);
            this.Close();
        }
    }
}
